// // 1亿条数据中找到最大的数
// const len = 100000000

// let i = 0
// let arr = []
// let half = len/2
// while (i < half){
//     const num = Math.random() * 100
//     arr.push(num)
// }

// 启动 worker
const worker = new Worker(new URL('./compute.worker.js', import.meta.url));

// 发送消息给 worker
worker.postMessage('start');

// 监听来自于 worker 的消息
worker.onmessage = function (event) {
    
    console.log('Received message length：' + event.data);

    // 结束 worker
    worker.terminate();
}



export default worker